
var Mock = require('mockjs')

//用户信息
module.exports = (req, res) => {
		//query、body = 前端请求传入的参数
		let {userName,passWord}= req.body || req.query;
	  var data = {
	  	body: req.body,
	  	query: req.query,
		code:0,
	  	message:"ok",
		};
		if(userName == 123456 || passWord == 123456){
			data.code = 200;
		}else{
			data.code = -101;
			data.message = "请输入正确的用户名与密码";
		}
		data['list|1-10']= [{
        // 属性 id 是一个自增数，起始值为 1，每次增 1
        "post_num":"@natural(60, 100)",
        "post_date":"@date()",
    }]

	  res.json(Mock.mock(data))
};
